﻿using System;
using UnityEngine;

// Token: 0x02000017 RID: 23
public class HankScript : MonoBehaviour
{
	// Token: 0x0600006C RID: 108 RVA: 0x0000D283 File Offset: 0x0000B483
	private void Start()
	{
		this.body = base.GetComponent<BodyScript>();
		if (!GameManager.main.isArena)
		{
			Object.Destroy(this);
			return;
		}
		if (PlayerPrefs.GetInt("hankAdded") > 0)
		{
			Object.Destroy(this);
		}
	}

	// Token: 0x0600006D RID: 109 RVA: 0x0000D2B7 File Offset: 0x0000B4B7
	private void Update()
	{
		if (!this.body.alive)
		{
			this.HankKilled();
		}
	}

	// Token: 0x0600006E RID: 110 RVA: 0x0000D2CC File Offset: 0x0000B4CC
	public void HankKilled()
	{
		PlayerPrefs.SetInt("runsCompleted", PlayerPrefs.GetInt("runsCompleted") + 1);
		PlayerPrefs.SetInt("hankAdded", 1);
		if (MusicManager.main)
		{
			MusicManager.main.fadeOut = true;
		}
		if (PlayerPrefs.GetInt("difficulty") == 2)
		{
			PauseManager.main.TryUnlockAchievement(11);
		}
		Object.Destroy(this);
	}

	// Token: 0x0400013B RID: 315
	private BodyScript body;
}
